import { useState, useEffect } from 'react'
import { getChannelListAPI } from '@/apis/article'

const useChannel = () => {
  const [channelList, setChannelList] = useState([])
  const getChannelListData = async () => {
    const res = await getChannelListAPI()
    setChannelList(res.data.channels)
  }
  useEffect(() => {
    getChannelListData()
  }, [])
  return {
    channelList
  }
}

export { useChannel }